package com.welsmann.app.start.common;

import java.util.Calendar;

/**
 * 系统工具类
 * 
 * @author Welsmann
 */
public class StartUtil {
	
	/**
	 * 获取今天的月和日
	 * 
	 * @return
	 */
	public static int[] getMonthAndDay() {
		Calendar c = Calendar.getInstance();
		int[] date = { c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH) };
		return date;
	}

	public static boolean isValidMonthAndDay(int month, int day) {
		return month >= 1 && month <= 12 && day >= 1 && day <= 31;
	}
	
	public static String getWeekName() {
		Calendar c = Calendar.getInstance();
		int code = c.get(Calendar.DAY_OF_WEEK);
		switch(code) {
		case 1:
			return "周日";
		case 2:
			return "周一";
		case 3:
			return "周二";
		case 4:
			return "周三";
		case 5:
			return "周四";
		case 6:
			return "周五";
		default: 
			return "周六";
		}
	}
	
	public static String formatUUID(String uuid, int upper, int dash) {
		if (upper > 0) {
			uuid = uuid.toUpperCase();
		}
		if (dash > 0) {
			uuid = uuid.replaceAll("-", "");
		}
		return uuid;
	}
}
